<template>
  <div class="home">
    <el-container>
<!--      头部导航栏-->
      <el-header height="80px"><el-row :gutter="20">
        <el-col :span="4"><img src="../assets/logo.png" class="logo"  alt=""/></el-col>
        <el-col :span="16"><h2>材料收集系统</h2></el-col>
        <el-col :span="4" ><span class="quit-login">退出登录</span></el-col>
      </el-row></el-header>


      <el-container>
        <el-aside width="200px">

          <!--          侧边栏-->
          <el-menu
              active-text-color="#ffd04b"
              background-color="#545c64"
              class="el-menu-vertical-demo"
              default-active="2"
              text-color="#fff"
              router
          >
            <el-menu-item :index="item.path" v-for="item in list" :key="item.path">
              <span>{{item.meta.title}}</span>
            </el-menu-item>

          </el-menu>


        </el-aside>
        <el-main>
          <!--          设置一个路由出口-->
          <router-view></router-view>

        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import {useRouter} from "vue-router";
export default defineComponent({
  name: 'HomeView',
  setup() {
    const router = useRouter()
    console.log(router.getRoutes());
    const list=router.getRoutes().filter(v=>v.meta.isShow)
    console.log(list);
    return {list};
  },
  components: {},
});
</script>

<style scoped lang="scss">

.el-header{
  height: 80px;
  background-color: #B3C0D1;
  .logo {
    width: 80px;
    height: 80px;
  }
  h2,.quit-login{
    text-align: center;
    height: 80px;
    line-height: 80px;
  }
}

.el-aside{

  .el-menu{
    height: calc(100vh - 80px);
  }
}

</style>
